<?php

		class Doc extends CI_Controller {
		
				function _construct(){
						parent::__construct();
				}
				
				function index(){
						die('Directory access is forbidden.');
				}
				
				function terms_of_business(){
						$data['base_url'] = base_url();
						$opts = read_options('company_name', 'OBJECT');
						$data['company_name'] 	= $opts->company_name;
						$this->load->view('terms_of_business', $data);
				}
				
				function partners_terms_of_business(){
						$data['base_url'] = base_url();
						$opts = read_options('company_name', 'OBJECT');
						$data['company_name'] 	= $opts->company_name;
						$this->load->view('partners_terms_of_business', $data);
				}
				
				function risk_disclosure(){
						$data['base_url'] = base_url();
						$opts = read_options('company_name', 'OBJECT');
						$data['company_name'] 	= $opts->company_name;
						$this->load->view('risk_disclosure', $data);
				}
				
				function aims_terms(){
						$data['base_url'] = base_url();
						$opts = read_options('company_name', 'OBJECT');
						$data['company_name'] 	= $opts->company_name;
						$this->load->view('aims_terms', $data);
				}
				
				function limited_power_of_attorney(){
						$data['base_url'] = base_url();
						$opts = read_options('company_name', 'OBJECT');
						$data['company_name'] 	= $opts->company_name;
						$this->load->view('limited_power_of_attorney', $data);
				}
				
				function risk_warning(){
						$data['base_url'] = base_url();
						$opts = read_options('company_name', 'OBJECT');
						$data['company_name'] 	= $opts->company_name;
						$this->load->view('risk_warning', $data);
				}
				
				function anti_money_loundering_policy(){
						$data['base_url'] = base_url();
						$opts = read_options('company_name', 'OBJECT');
						$data['company_name'] 	= $opts->company_name;
						$this->load->view('anti_money_loundering_policy', $data);
				}
				
				function _resolve_lang(){
						$langs = array('en','fr');
						$lang  = '';
						for($i=3;$i<$this->uri->total_segments();$i++)
						{
								if($this->uri->segment($i)=='lang' && $this->uri->segment($i+1) && in_array($this->uri->segment($i+1),$langs))
								{
										$lang = $this->uri->segment($i+1);
										break;
								}
						}
						if(!$lang && $this->session->userdata('sess_lang'))
						{
								$lang = $this->session->userdata('sess_lang');
						}
						if( !in_array($lang,$langs) ) $lang = $langs[0];
						if($lang) $this->session->set_userdata('sess_lang', $lang);
						return $lang;
				}

		}

?>